/*
*  CEString.h 
*  LID Library
*
*  Created by Alexander Trutchenko on 11/01/12.
*  Copyright 2012 League of Independent Developers. All rights reserved.
*
*/

#ifndef __CE_String_h__
#define __CE_String_h__

#include "cocos2d.h"
#include "lid_lib/src/types/LLTypes.h"

#include <string>

namespace cocosext {


////////////////////////////////////////////////////////
//
/** CEWString
*  It if a wide char CCString
*/
////////////////////////////////////////////////////////

    
class CEWString : public cocos2d::CCObject
{
public:
    std::wstring _string;

public:
    CEWString() {}
    CEWString(const wchar_t * str): _string(str) {;}
    CEWString(const std::wstring& str): _string(str) {;}
    virtual ~CEWString() {}

   inline std::wstring& toStdString() { return _string; }
   inline const std::wstring& toStdString() const { return _string; }
   inline const wchar_t* toCString() const { return _string.c_str(); }
   inline bool isEmpty() const { return _string.empty(); }
   virtual bool isEqual(const CCObject* pObject) const
   {
       bool bRet = false;
       const CEWString* pStr = dynamic_cast<const CEWString*>(pObject);
       if (pStr != NULL)
       {
           if (0 == _string.compare(pStr->_string))
           {
               bRet = true;
           }
       }
       return bRet;
   }
};

} // namespace cocosext

#endif //__CE_String_h__
